package com.weixin.text;

import java.sql.SQLException;
import java.util.Date;
import java.util.List;

import com.weixin.entity.HouseGoods;
import com.weixin.service.IHouseGoodsService;
import com.weixin.service.impl.HouseGoodsServiceImpl;

public class HouseGoodsText {
	public static void main(String[] args) throws SQLException {
		IHouseGoodsService service=new HouseGoodsServiceImpl();
		List<HouseGoods> selectAll = service.selectAll();
		double sumTotal=0.0;
		for (HouseGoods houseGoods : selectAll) {
			if(houseGoods.getSum()!=null) {				
				sumTotal=sumTotal+houseGoods.getSum();
			}
		}
		System.out.println(sumTotal);
//		System.out.println(service.getAllAbout());
//		HouseGoods housegoods = service.selectByGoodsId(100);
//		System.out.println(housegoods);
//		if(housegoods!=null) {
//			System.out.println("有");
//		}else {
//			System.out.println("没有");
//		}
		
//		System.out.println(service.selectAll());
//		System.out.println(service.selectById(1));
//		
//		HouseGoods houseGoods=new HouseGoods();
//		houseGoods.setGoods_id(1);
//		houseGoods.setNumber(30);
//		houseGoods.setSum(3000);
//		houseGoods.setPurchase_time(new Date());
//		houseGoods.setPurchase_people_id(1);
//		houseGoods.setStorehouse_id(2);
//		houseGoods.setRemark("还没坏");
//		System.out.println(service.insertHGoods(houseGoods));
//		HouseGoods houseGoods=service.selectById(2);
//		houseGoods.setNumber(40);
//		System.out.println(service.updateHGoods(houseGoods));
//		System.out.println(service.deleteById(2));
	}
}
